import { FC } from "react";
import { Outlet } from "react-router-dom";
import useLoadUserData from "../../hooks/useLoadUserData";
import { Spin } from "antd";
import { useNavPage } from "../../hooks/useNavPage";
const OutletProvider: FC = () => {
  const { waitingUserData } = useLoadUserData();
  useNavPage(waitingUserData);
  if (waitingUserData) {
    return (
      <div className="h-screen w-full flex justify-center  items-center">
        <Spin size="large" tip="Loading...">
          <div className="w-32 h-32"></div>
        </Spin>
      </div>
    );
  }
  return <Outlet></Outlet>;
};

export default OutletProvider;
